// Code generated by go-swagger; DO NOT EDIT.

package act_device_api_service

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// New creates a new act device api service API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
	return &Client{transport: transport, formats: formats}
}

/*
Client for act device api service API
*/
type Client struct {
	transport runtime.ClientTransport
	formats   strfmt.Registry
}

// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)

// ClientService is the interface for Client methods
type ClientService interface {
	ActDeviceAPIServiceCreateDeviceV1(params *ActDeviceAPIServiceCreateDeviceV1Params, opts ...ClientOption) (*ActDeviceAPIServiceCreateDeviceV1OK, error)

	ActDeviceAPIServiceDescribeDeviceV1(params *ActDeviceAPIServiceDescribeDeviceV1Params, opts ...ClientOption) (*ActDeviceAPIServiceDescribeDeviceV1OK, error)

	ActDeviceAPIServiceListDevicesV1(params *ActDeviceAPIServiceListDevicesV1Params, opts ...ClientOption) (*ActDeviceAPIServiceListDevicesV1OK, error)

	ActDeviceAPIServiceRemoveDeviceV1(params *ActDeviceAPIServiceRemoveDeviceV1Params, opts ...ClientOption) (*ActDeviceAPIServiceRemoveDeviceV1OK, error)

	ActDeviceAPIServiceUpdateDeviceV1(params *ActDeviceAPIServiceUpdateDeviceV1Params, opts ...ClientOption) (*ActDeviceAPIServiceUpdateDeviceV1OK, error)

	SetTransport(transport runtime.ClientTransport)
}

/*
ActDeviceAPIServiceCreateDeviceV1 creates device v1 create a device
*/
func (a *Client) ActDeviceAPIServiceCreateDeviceV1(params *ActDeviceAPIServiceCreateDeviceV1Params, opts ...ClientOption) (*ActDeviceAPIServiceCreateDeviceV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewActDeviceAPIServiceCreateDeviceV1Params()
	}
	op := &runtime.ClientOperation{
		ID:                 "ActDeviceApiService_CreateDeviceV1",
		Method:             "POST",
		PathPattern:        "/api/v1/devices",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &ActDeviceAPIServiceCreateDeviceV1Reader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	}
	for _, opt := range opts {
		opt(op)
	}

	result, err := a.transport.Submit(op)
	if err != nil {
		return nil, err
	}
	success, ok := result.(*ActDeviceAPIServiceCreateDeviceV1OK)
	if ok {
		return success, nil
	}
	// unexpected success response
	unexpectedSuccess := result.(*ActDeviceAPIServiceCreateDeviceV1Default)
	return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}

/*
ActDeviceAPIServiceDescribeDeviceV1 describes device v1 describe a device
*/
func (a *Client) ActDeviceAPIServiceDescribeDeviceV1(params *ActDeviceAPIServiceDescribeDeviceV1Params, opts ...ClientOption) (*ActDeviceAPIServiceDescribeDeviceV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewActDeviceAPIServiceDescribeDeviceV1Params()
	}
	op := &runtime.ClientOperation{
		ID:                 "ActDeviceApiService_DescribeDeviceV1",
		Method:             "GET",
		PathPattern:        "/api/v1/devices/{deviceId}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &ActDeviceAPIServiceDescribeDeviceV1Reader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	}
	for _, opt := range opts {
		opt(op)
	}

	result, err := a.transport.Submit(op)
	if err != nil {
		return nil, err
	}
	success, ok := result.(*ActDeviceAPIServiceDescribeDeviceV1OK)
	if ok {
		return success, nil
	}
	// unexpected success response
	unexpectedSuccess := result.(*ActDeviceAPIServiceDescribeDeviceV1Default)
	return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}

/*
ActDeviceAPIServiceListDevicesV1 lists devices v1 list of devices
*/
func (a *Client) ActDeviceAPIServiceListDevicesV1(params *ActDeviceAPIServiceListDevicesV1Params, opts ...ClientOption) (*ActDeviceAPIServiceListDevicesV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewActDeviceAPIServiceListDevicesV1Params()
	}
	op := &runtime.ClientOperation{
		ID:                 "ActDeviceApiService_ListDevicesV1",
		Method:             "GET",
		PathPattern:        "/api/v1/devices",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &ActDeviceAPIServiceListDevicesV1Reader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	}
	for _, opt := range opts {
		opt(op)
	}

	result, err := a.transport.Submit(op)
	if err != nil {
		return nil, err
	}
	success, ok := result.(*ActDeviceAPIServiceListDevicesV1OK)
	if ok {
		return success, nil
	}
	// unexpected success response
	unexpectedSuccess := result.(*ActDeviceAPIServiceListDevicesV1Default)
	return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}

/*
ActDeviceAPIServiceRemoveDeviceV1 removes device v1 remove a device
*/
func (a *Client) ActDeviceAPIServiceRemoveDeviceV1(params *ActDeviceAPIServiceRemoveDeviceV1Params, opts ...ClientOption) (*ActDeviceAPIServiceRemoveDeviceV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewActDeviceAPIServiceRemoveDeviceV1Params()
	}
	op := &runtime.ClientOperation{
		ID:                 "ActDeviceApiService_RemoveDeviceV1",
		Method:             "DELETE",
		PathPattern:        "/api/v1/devices/{deviceId}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &ActDeviceAPIServiceRemoveDeviceV1Reader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	}
	for _, opt := range opts {
		opt(op)
	}

	result, err := a.transport.Submit(op)
	if err != nil {
		return nil, err
	}
	success, ok := result.(*ActDeviceAPIServiceRemoveDeviceV1OK)
	if ok {
		return success, nil
	}
	// unexpected success response
	unexpectedSuccess := result.(*ActDeviceAPIServiceRemoveDeviceV1Default)
	return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}

/*
ActDeviceAPIServiceUpdateDeviceV1 updates device v1 update a device
*/
func (a *Client) ActDeviceAPIServiceUpdateDeviceV1(params *ActDeviceAPIServiceUpdateDeviceV1Params, opts ...ClientOption) (*ActDeviceAPIServiceUpdateDeviceV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewActDeviceAPIServiceUpdateDeviceV1Params()
	}
	op := &runtime.ClientOperation{
		ID:                 "ActDeviceApiService_UpdateDeviceV1",
		Method:             "PUT",
		PathPattern:        "/api/v1/devices/{deviceId}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &ActDeviceAPIServiceUpdateDeviceV1Reader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	}
	for _, opt := range opts {
		opt(op)
	}

	result, err := a.transport.Submit(op)
	if err != nil {
		return nil, err
	}
	success, ok := result.(*ActDeviceAPIServiceUpdateDeviceV1OK)
	if ok {
		return success, nil
	}
	// unexpected success response
	unexpectedSuccess := result.(*ActDeviceAPIServiceUpdateDeviceV1Default)
	return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}

// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
	a.transport = transport
}
